# -*- coding:utf-8 -*-
__author__ = 'shuxin'
__date__ = '2020/9/17  13:40'

import json

from django.http import HttpResponse
from django.views import View


class OrderExportView(View):
    def post(self, request):
        info = {
            "ResponseBody": {
                "GetCoopRefundConfirmListItems": [
                    {
                        "OrderId": 12411014983,
                        "OrderType": 5,
                        "Prid": 87545768,
                        "FeeType": "待确认",
                        "IsForceAudited": 0,
                        "RefundServerFee": 0,
                        "Currency": "CNY",
                        "ConversionRate": 1,
                        "GetCoopRefundConfirmDetailItems": [
                            {
                                "GetCoopRefundConfirmDetailItemID": 124350031,
                                "RefundType": "自愿",
                                "AirLineCode": "900",
                                "TicketNO": "0000001462",
                                "IssueBillID": 562768820,
                                "IsRebook": False,
                                "RecordNO": "LXECRG",
                                "PassengerName": "CHEUNPREECHA/SANCHAI",
                                "Dport": "KKC",
                                "Aport": "DMK",
                                "Sequence": 1,
                                "TakeOffTime": "/Date(1585721100000+0800)/",
                                "Flight": "FD3255 ",
                                "SubClass": "K",
                                "FlightChangeProve": "",
                                "Cost": 79,
                                "OilFee": 0,
                                "Tax": 10,
                                "RefundRate": 0,
                                "RefundFee": 0,
                                "UsedCost": 0,
                                "UsedTax": 0,
                                "PayFlightAgency": -89,
                                "PrintPrice": 79,
                                "CommissionFee": -79,
                                "Subsidy": 0,
                                "RbkID": 0
                            }
                        ],
                        "IsConfirm": 0,
                        "Audited": "F",
                        "RT_Oper": "System",
                        "RT_Time": "2020-04-24 23:02:02",
                        "FlightClass": "I",
                        "PrepayType": "CCARD",
                        "Tickets": 1,
                        "RefundDesc": "行程单未打印;航段1 自愿 CHEUNPREECHA/SANCHAI，退/改金额0.00,费率0.00。 \n",
                        "IsRefund": "F",
                        "TakeOffTime": "/Date(1585721100000+0800)/",
                        "Row": 1,
                        "CountNumber": 3,
                        "Urgency": 3,
                        "RefundReason": "",
                        "EMDFlag": "T"
                    },
                    {
                        "OrderId": 12435685674,
                        "OrderType": 5,
                        "Prid": 87501689,
                        "FeeType": "待确认",
                        "IsForceAudited": 0,
                        "RefundServerFee": 0,
                        "Currency": "CNY",
                        "ConversionRate": 1,
                        "GetCoopRefundConfirmDetailItems": [
                            {
                                "GetCoopRefundConfirmDetailItemID": 124284502,
                                "RefundType": "航变",
                                "AirLineCode": "807",
                                "TicketNO": "0000002109",
                                "IssueBillID": 563636357,
                                "IsRebook": False,
                                "RecordNO": "QQOGRM",
                                "PassengerName": "SARAYEVA/XENIYA",
                                "Dport": "DMK",
                                "Aport": "KUL",
                                "Sequence": 1,
                                "TakeOffTime": "/Date(1588940400000+0800)/",
                                "Flight": "AK889  ",
                                "SubClass": "K",
                                "FlightChangeProve": "",
                                "Cost": 214,
                                "OilFee": 0,
                                "Tax": 31,
                                "RefundRate": 0,
                                "RefundFee": 0,
                                "UsedCost": 0,
                                "UsedTax": 0,
                                "PayFlightAgency": -245,
                                "PrintPrice": 214,
                                "CommissionFee": -214,
                                "Subsidy": 0,
                                "RbkID": 0
                            },
                            {
                                "GetCoopRefundConfirmDetailItemID": 124284503,
                                "RefundType": "航变",
                                "AirLineCode": "807",
                                "TicketNO": "0000001304",
                                "IssueBillID": 563636357,
                                "IsRebook": False,
                                "RecordNO": "QQOGRM",
                                "PassengerName": "SHCHERBININ/ALEXANDER",
                                "Dport": "DMK",
                                "Aport": "KUL",
                                "Sequence": 1,
                                "TakeOffTime": "/Date(1588940400000+0800)/",
                                "Flight": "AK889  ",
                                "SubClass": "K",
                                "FlightChangeProve": "",
                                "Cost": 214,
                                "OilFee": 0,
                                "Tax": 31,
                                "RefundRate": 0,
                                "RefundFee": 0,
                                "UsedCost": 0,
                                "UsedTax": 0,
                                "PayFlightAgency": -245,
                                "PrintPrice": 214,
                                "CommissionFee": -214,
                                "Subsidy": 0,
                                "RbkID": 0
                            }
                        ],
                        "IsConfirm": 0,
                        "Audited": "F",
                        "RT_Oper": "System",
                        "RT_Time": "2020-04-24 02:43:23",
                        "FlightClass": "I",
                        "PrepayType": "CCARD",
                        "Tickets": 2,
                        "RefundDesc": "行程单未打印;航段1 航变 SARAYEVA/XENIYA，退/改金额0.00,费率0.00。 航段1 航变 SHCHERBININ/ALEXANDER，退/改金额0.00,费率0.00。 \n",
                        "IsRefund": "F",
                        "TakeOffTime": "/Date(1588940400000+0800)/",
                        "Row": 2,
                        "CountNumber": 3,
                        "Urgency": 3,
                        "RefundReason": "",
                        "EMDFlag": "T"
                    },
                    {
                        "OrderId": 12459623458,
                        "OrderType": 5,
                        "Prid": 87528931,
                        "FeeType": "待确认",
                        "IsForceAudited": 0,
                        "RefundServerFee": 0,
                        "Currency": "CNY",
                        "ConversionRate": 1,
                        "GetCoopRefundConfirmDetailItems": [
                            {
                                "GetCoopRefundConfirmDetailItemID": 124325208,
                                "RefundType": "航变",
                                "AirLineCode": "900",
                                "TicketNO": "0000001945",
                                "IssueBillID": 564490124,
                                "IsRebook": False,
                                "RecordNO": "HHEEBD",
                                "PassengerName": "KORENCHENKO/ARTEM",
                                "Dport": "DMK",
                                "Aport": "SGN",
                                "Sequence": 1,
                                "TakeOffTime": "/Date(1590449400000+0800)/",
                                "Flight": "FD656  ",
                                "SubClass": "K",
                                "FlightChangeProve": "",
                                "Cost": 201,
                                "OilFee": 0,
                                "Tax": 8,
                                "RefundRate": 0,
                                "RefundFee": 0,
                                "UsedCost": 0,
                                "UsedTax": 0,
                                "PayFlightAgency": -209,
                                "PrintPrice": 201,
                                "CommissionFee": -201,
                                "Subsidy": 0,
                                "RbkID": 0
                            }
                        ],
                        "IsConfirm": 0,
                        "Audited": "F",
                        "RT_Oper": "System",
                        "RT_Time": "2020-04-24 16:55:41",
                        "FlightClass": "I",
                        "PrepayType": "CCARD",
                        "Tickets": 1,
                        "RefundDesc": "行程单未打印;航段1 航变 KORENCHENKO/ARTEM，退/改金额0.00,费率0.00。 \n",
                        "IsRefund": "F",
                        "TakeOffTime": "/Date(1590449400000+0800)/",
                        "Row": 3,
                        "CountNumber": 3,
                        "Urgency": 3,
                        "RefundReason": "",
                        "EMDFlag": "T"
                    }
                ]
            },
            "Header": {
                "ShouldRecordPerformanceTime": False,
                "RequestID": "b5dd01f5-939e-46b9-81ed-6a57de189ff2",
                "ResultCode": 0,
                "AssemblyVersion": "2.9.8.0",
                "RequestBodySize": 0,
                "SerializeMode": 0,
                "RouteStep": 1,
                "Environment": "PRO"
            }
        }

        error_info = {
            "status": "F103",
            "msg": "订单状态不正确",
            "orderLists": None
        }

        return HttpResponse(json.dumps(info, ensure_ascii=False), content_type="application/json")
